# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html


# useful for handling different item types with a single interface
import os
from itemadapter import ItemAdapter
from scrapy.pipelines.files import FilesPipeline


class ApkcrawlerPipeline:
    def process_item(self, item, spider):
        print(item, 'hello')
        return item


class AnzhiFilesPipeline(FilesPipeline):
    def item_completed(self, results, item, info):
        # relative_path = [x['path'] for ok, x in results if ok][0]
        # file_path = os.path.join(
        #     self.crawler.spider.settings.get('FILES_STORE'), relative_path)
        return item
